package com.ay277.htqoa.base.dao;

import com.ay277.htqoa.base.entity.User;
import org.hibernate.query.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by Administrator on 2016/12/9.
 */
@Repository
public class UserDaoImpl extends BaseDao<User,String>  implements UserDao {
    { type=User.class;}

    @Override
    public User findUser(String userid, String pwd) {
        List<User> user= (List<User>) this.getHibernateTemplate().find("from User where userid=? and pwd=?",userid,pwd);
        if(user.size()>0)return user.get(0);
        else return null;
    }
}
